﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace pGrid
{

  class AuctionManager
  {
    private int m_yourBet;
    private int m_highestBet;
    private int m_playersInAuction;
    private int m_turn;
    private int m_pos;
    private int m_selected_station_index;
    private Player m_highestBetPlayer;
    private Player m_currentPlayer;
    private PowerStation m_currentStation;
    private bool m_auctionInAction;

    public AuctionManager()
    {
      m_pos = 0;
    }

    public int SelectedStationIndex
    {
      get
      {
        return m_selected_station_index;
      }
      set
      {
        m_selected_station_index = value;
      }
    }
    public int YourBet
    {
      get
      {
        return m_yourBet;
      }
      set
      {
        m_yourBet = value;
      }
    }

    public int HighestBet
    {
      get
      {
        return m_highestBet;
      }
      set
      {
        m_highestBet = value;
      }
    }

    public int PlayersInAuction
    {
      get
      {
        return m_playersInAuction;
      }
      set
      {
        m_playersInAuction = value;
      }
    }

    public int Turn
    {
      get
      {
        return m_turn;
      }
      set
      {
        m_turn = value;
      }
    }

    public int Pos
    {
      get
      {
        return m_pos;
      }
      set
      {
        m_pos = value;
      }
    }

    public Player HighestBetPlayer
    {
      get
      {
        return m_highestBetPlayer;
      }
      set
      {
        m_highestBetPlayer = value;
      }
    }

    public Player CurrentPlayer
    {
      get
      {
        return m_currentPlayer;
      }
      set
      {
        m_currentPlayer = value;
      }
    }

    public PowerStation CurrentStation
    {
      get
      {
        return m_currentStation;
      }
      set
      {
        m_currentStation = value;
        m_highestBet = value.Cost;
        m_yourBet = value.Cost;
      }
    }

    public bool AuctionInAction
    {
      get
      {
        return this.m_auctionInAction;
      }
      set
      {
        this.m_auctionInAction = value;
      }
    }

    public void Init()
    {
      m_pos = m_turn;
      m_playersInAuction = 0;
      m_auctionInAction = true;
      m_yourBet = 0;
      m_highestBet = 0;
    }
  }
}
